package com.google.gwt.mobile.phonegap.api;

/**
 * The Class Storage.
 */
public class Storage {

  /**
   * The Class LocalStorage.
   */
  public static class LocalStorage {

    /**
     * Key.
     * 
     * @param index the index
     * @return the string
     */
    public native static String key(int index) /*-{
			return $wnd.localStorage.key(index);
    }-*/;

    /**
     * Sets the item.
     * 
     * @param key the key
     * @param value the value
     */
    public native static void setItem(String key, String value) /*-{
			$wnd.localStorage.setItem(key, value);
    }-*/;

    /**
     * Gets the item.
     * 
     * @param key the key
     * @return the item
     */
    public native static String getItem(String key) /*-{
			return $wnd.localStorage.getItem(key);
    }-*/;

    /**
     * Removes the item.
     * 
     * @param key the key
     */
    public native static void removeItem(String key) /*-{
			$wnd.localStorage.removeItem(key);
    }-*/;

    /**
     * Clear.
     */
    public native static void clear() /*-{
			$wnd.localStorage.clear();
    }-*/;
  }

}
